#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <assert.h>

//int main()
//{
//	char arr1[20] = "*****************";
//	char arr2[] = "abc";
//	strcpy(arr1, arr2);
//	printf("%s", arr1);
//	return 0;
//}

//int main()
//{
//	char arr1[] = "abc";
//	char arr2[] = "xxxxxx";	//err
//	strcpy(arr1, arr2);
//	printf("%s", arr1);
//	return 0;
//}

//int main()
//{
//	char* p = "hello world";//err
//	char arr[] = "abc";
//	strcpy(p, arr);
//	return 0;
//}


char* my_strcpy(char* dest, const char* src)
{
	assert(dest && src);
	char* ret = dest;
	while (*dest++ = *src++)
	{
		;
	}
	return ret;
}

int main()
{
	char arr1[40] = "*****";
	char arr2[] = "abcdefg";
	printf("%s\n", my_strcpy(arr1, arr2));
	printf("%s\n", arr1);
	return 0;
}